---
title: Calendar
description: Displays an 8-bit calendar component.
---

import { Calendar } from "@/components/ui/8bit/calendar";
import CopyCommandButton from "@/components/copy-command-button";
import InstallationCommands from "@/components/installation-commands";
import ComponentPreview from "@/components/component-preview";
import { CalendarExample } from "@/components/examples/calendar";

<div className="flex flex-col md:flex-row items-center justify-end gap-2 mb-2">
  <CopyCommandButton
    copyCommand="pnpm dlx shadcn@latest add @8bitcn/calendar"
    command="pnpm dlx shadcn@latest add @8bitcn/calendar"
  />
</div>

<ComponentPreview title="8-bit Calendar component" name="calendar">
  <CalendarExample />
</ComponentPreview>

## Installation

---

<InstallationCommands packageName="calendar" />

## Usage

---

```tsx
import { Calendar } from "@/components/ui/8bit/calendar"
```

```tsx
const [date, setDate] = React.useState<Date | undefined>(new Date())

<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
/>
```

